<template>
  <div class="login-container">
    <el-form class="login-form" ref="form" :model="user">
      <div class="logo-img">
        <img src="./logo.png">
      </div>
      <el-form-item>
        <el-input prefix-icon="el-icon-mobile-phone"  v-model="user.mobile" placeholder="请输入手机"></el-input>
      </el-form-item>
      <el-form-item>
        <el-input prefix-icon="el-icon-lock" v-model="user.code" placeholder="请输入验证码"></el-input>
      </el-form-item>
      <el-form-item prop="agree">
        <el-checkbox v-model="user.agree">我已阅读并同意用户协议和隐私条款</el-checkbox>
      </el-form-item>
      <el-form-item>
        <el-button class="login-btn" type="primary" @click="onLogin">登录</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name: 'login',
  data () {
    return {
      user: {
        mobile: '',
        code: '',
        agree: true
      }
    }
  },
  methods: {
    onLogin () {
      console.log('submit!')
    }
  }
}
</script>

<style scoped lang="less">
  .login-container{
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: url("./login_bg.jpg") no-repeat;
    background-size: cover;
    .login-form{
      background-color: #ffffff;
      padding: 10px 50px;
      min-width: 300px;
      .logo-img{
        width: 50%;
        margin: 20px auto;

        img{
          width: 100%;
        }
      }
    }
    .login-btn{
      width: 100%;
    }
  }
</style>
